The disclosed embodiments of the present invention relate to accessing a storage medium, and more particularly, to methods of utilizing an address mapping table, such as a flash translation layer (FTL) mapping table, to manage data access of a storage medium, such as a solid-state disk or a hard disk, without physically accessing the storage medium and related storage controllers thereof.
In general, fragmented files are files whose contents are split up into chunks, and stored in various locations within a storage medium. Fragmentation occurs over time as the files on the storage medium are added, deleted and modified. Therefore, defragmentation technique is commonly employed in a file system to reduce the number of fragmented files. Taking a hard disk drive for example, the data access performance highly depends upon the seeking performance of a magnetic head. If contents of a file can be recorded in successive storage areas on a hard disk, the seeking time required by the magnetic head can be significantly reduced, leading to improved data access performance accordingly. With regard to a solid-state disk (SSD) drive, the storage medium is generally consisted of flash memory devices. As the flash memory device has the random access capability, the SSD drive, compared to the hard disk drive, may not need file defragmentation applied thereto for reducing the seek time. In addition, the flash memory device has its limited service life due to the inherent characteristics thereof. As the file defragmentation generally requires data move operations, the flash memory device is read and written many times during the file defragmentation process, which may shorten the service life of the SSD drive. However, in a case where the service life of the flash memory is not affected, the file defragmentation applied to the SSD drive to make the contents of the files stored in successive storage areas might gain certain benefits. For example, the required file management effort is simplified and the data access speed can be increased accordingly; in addition, the efficiency of releasing the occupied storage areas as free areas can be improved.
Thus, what is needed is a data handling scheme that allows for efficient file defragmentation/data access of a storage medium.